package com.wxd.controller;

import com.github.pagehelper.PageInfo;
import com.guigu.pojo.TMeals;
import com.guigu.pojo.TSportsItemLibrary;
import com.wxd.service.TSportsService;
import com.wxd.vo.PageVo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
public class TSportsControllers {
    @Resource
    TSportsService tSportsService;
    //分页查询全部
//    @PostMapping("selectSports")
//    public PageInfo<TSportsItemLibrary> tSportsItemLibrary(@RequestBody PageVo<TSportsItemLibrary> pageVo){
//        System.out.println("***************"+pageVo.toString());
//        return this.tSportsService.PaginationQuery(pageVo);
//    }
    @RequestMapping(value = "TSportsQuery")
    public PageInfo<TSportsItemLibrary> tsportsQuery(@RequestBody PageVo<TSportsItemLibrary> pageVo){
        System.out.println("***************"+pageVo.toString());
        PageInfo<TSportsItemLibrary> bate=this.tSportsService.TSportsQuery(pageVo);
        return bate;
    }
    //添加
    @RequestMapping("TSportsInsert")
    public void TSportsInsert(@RequestBody TSportsItemLibrary tSportsItemLibrary){
        this.tSportsService.Insert(tSportsItemLibrary);
    }
    //修改
    @RequestMapping("TSportsUpdate")
    public void TSportsUpdate(@RequestBody TSportsItemLibrary tSportsItemLibrary){
        this.tSportsService.UpdateByPrimaryKey(tSportsItemLibrary);
    }
    //删除
    @RequestMapping("TSportsDelete")
    public void TSportsDelete(@RequestBody TSportsItemLibrary tSportsItemLibrary){
        this.tSportsService.deleteByPrimaryKey(tSportsItemLibrary);
    }
}
